part of 'bloc.dart';

class SingleLexicalItemPageBlocState {
  const SingleLexicalItemPageBlocState({
    required this.lexicalItem,
    required this.imagePath,
    required this.dialect,
    required this.safeToPronounce,
    required this.cardActions,
    required this.lexicalItemExplicitlyDeleted,
    this.usedCustomLexicalItemDeletionDialogShown = false,
    this.orphanCustomLexicalItemDeletionDialogShown = false,
  });

  final LexicalItem lexicalItem;
  final String? imagePath;
  final Dialect dialect;
  final bool safeToPronounce;
  final BuiltList<CardAction> cardActions;
  final bool lexicalItemExplicitlyDeleted;
  final bool usedCustomLexicalItemDeletionDialogShown;
  final bool orphanCustomLexicalItemDeletionDialogShown;

  SingleLexicalItemPageBlocState copyWith({
    LexicalItem Function()? lexicalItem,
    String? Function()? imagePath,
    Dialect Function()? dialect,
    bool Function()? safeToPronounce,
    BuiltList<CardAction> Function()? cardActions,
    bool Function()? lexicalItemExplicitlyDeleted,
    bool Function()? usedCustomLexicalItemDeletionDialogShown,
    bool Function()? orphanCustomLexicalItemDeletionDialogShown,
  }) {
    return SingleLexicalItemPageBlocState(
      lexicalItem: lexicalItem == null ? this.lexicalItem : lexicalItem(),
      imagePath: imagePath == null ? this.imagePath : imagePath(),
      dialect: dialect == null ? this.dialect : dialect(),
      safeToPronounce: safeToPronounce == null ? this.safeToPronounce : safeToPronounce(),
      cardActions: cardActions == null ? this.cardActions : cardActions(),
      lexicalItemExplicitlyDeleted: lexicalItemExplicitlyDeleted == null
          ? this.lexicalItemExplicitlyDeleted
          : lexicalItemExplicitlyDeleted(),
      usedCustomLexicalItemDeletionDialogShown:
          usedCustomLexicalItemDeletionDialogShown?.call() ?? false,
      orphanCustomLexicalItemDeletionDialogShown:
          orphanCustomLexicalItemDeletionDialogShown?.call() ?? false,
    );
  }
}
